<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //作为常量
        const VIDEO = Symbol();
        const AUDIO = Symbol();
        const IMAGE = Symbol();

        function play(type) {
            switch (type) {
                case VIDEO:
                    console.log("视频播放")
                    break;
                case AUDIO:
                    console.log("音频播放")
                    break;
                case IMAGE:
                    console.log("图片播放")
                    break;
            }
        }
        //这样就能统一代码的一致性，只能使用这三个常量
        play(VIDEO)
    </script>
</body>

</html>